package com.wqz.dao;

import com.wqz.pojo.User;
import com.wqz.utils.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

import static org.junit.Assert.*;

public class UserDaoTest {

    @Test
    public void findUser() {
    }

    @Test
    public void findUserById() {
    }

    @Test
    public void findUserListById() {

        SqlSession sqlSession = MyBatisUtil.createSqlSession();
        UserDao userDao = sqlSession.getMapper(UserDao.class);
        try {

            List<User> userList = userDao.findUserListById(1);
            for (User user : userList) {
                System.out.println(user);
            }
            System.out.println(userList.size());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}